import 'package:fashion_app/components/bottom_nav.dart';
import 'package:fashion_app/components/top_nav.dart';
import 'package:fashion_app/pages/homePages/components/recomd_card.dart';
import 'package:fashion_app/pages/homePages/components/user_greeting.dart';
import 'package:fashion_app/pages/homePages/mock.dart';
import 'package:flutter/material.dart';

class HomePage extends StatefulWidget {
  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Padding(
        padding: EdgeInsets.symmetric(horizontal: 16), // 添加左右padding
        child: CustomScrollView(
          slivers: [
            SliverToBoxAdapter(child: UserGreeting()),
            SliverToBoxAdapter(
              child: RecomdCardArea(recomdList: homeData.recomdList),
            ),
          ],
        ),
      ),
      bottomNavigationBar: BottomNav(initialIndex: 0),
      appBar: PreferredSize(
        preferredSize: Size.fromHeight(kToolbarHeight),
        child: TopNav(hasUnreadMessages: true),
      ),
    );
  }
}
